;; coding

;; (use-package rust-mode
;;   :ensure t)

;; (use-package lsp-mode
;;   :init (setq lsp-keymap-prefix "C-c l")
;;   :hook ((lsp-mode . lsp-enable-which-key-intergration)
;; 	 (rust-mode . lsp-deferred))
;;   :commands (lsp lsp-deferred)
;;   :ensure t)


;; 自动补全
(use-package company
  :hook (after-init . global-company-mode)
  :config (setq company-minimum-prefix-length 1
                company-show-quick-access t))

(use-package company-box
  :ensure t
  :if window-system
  :hook (company-mode . company-box-mode))


;; snippet
(use-package yasnippet
  :ensure t
  :hook ((lsp-mode . yas-minor-mode)))

;; 语法检查
(use-package flymake
  :hook (prog-mode . flymake-mode)
  :config
  (global-set-key (kbd "M-n") #'flymake-goto-next-error)
  (global-set-key (kbd "M-p") #'flymake-goto-prev-error))


(provide 'init-lsp)
